package com.orange.score.activity.repository;

import android.app.AlertDialog.Builder;
import android.app.Dialog;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.GestureDetector;
import android.view.GestureDetector.OnGestureListener;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.Button;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;
import com.orange.score.activity.common.CommonFootballActivity;
import com.orange.score.app.ScoreApplication;
import com.orange.score.model.league.League;
import com.orange.score.model.league.LeagueManager;
import com.orange.score.model.repository.RepositoryManager;
import com.orange.score.network.ResultCodeType;
import com.orange.score.service.RepositoryService;
import com.orange.score.service.RepositoryServiceCallBack;
import java.util.List;
import java.util.Timer;
import java.util.TimerTask;

public class LeagueScheduleActivity extends CommonFootballActivity
  implements RepositoryServiceCallBack, View.OnTouchListener, GestureDetector.OnGestureListener
{
  private static final int DAXIAO = 3;
  private static final int FLING_MIN_DISTANCE = 60;
  private static final int FLING_MIN_VELOCITY = 0;
  private static String LEAGUE_REPOSITORY_HTML;
  public static final int MAX_LOADING_TIME = 8000;
  private static final int POINTS = 0;
  private static final int RANGQIU = 2;
  private static final int SCHEDULE = 1;
  private static final int SHOOTER = 4;
  private static String TAG = LeagueScheduleActivity.class.getName();
  Button btn_league_daxiao;
  Button btn_league_points;
  Button btn_league_rangqiu;
  Button btn_league_schedule;
  Button btn_league_season;
  Button btn_league_shooter;
  Button btn_schedule_current_round;
  Button btn_schedule_next_round;
  Button btn_schedule_previous_round;
  Bundle bundle;
  int currentRound;
  String currentSeason;
  private int currentSelection = 0;
  Handler errorHandler;
  GestureDetector gestureDetector;
  Handler handler;
  boolean hasProgress;
  Timer hideDialogTimer;
  String jsUrl;
  int lastCheckedRound;
  int lastCheckedSeason;
  RelativeLayout layout_round;
  League league;
  String leagueId;
  LeagueManager leagueManager;
  boolean loadingJs;
  boolean refreshFlag;
  RepositoryManager repositoryManager;
  CharSequence[] rounds;
  CharSequence[] seasons;
  long startLoadingTime;
  int totalRound;
  TextView txt_league_season;
  WebView webView;

  static
  {
    LEAGUE_REPOSITORY_HTML = "file:///android_asset/repository.html";
  }

  public LeagueScheduleActivity()
  {
    this.currentSeason = "";
    this.lastCheckedSeason = 0;
    this.lastCheckedRound = 1;
    this.jsUrl = "";
    this.handler = new Handler();
    this.hasProgress = false;
    this.loadingJs = false;
    this.startLoadingTime = 0L;
    this.errorHandler = new Handler();
    this.refreshFlag = false;
  }

  private String getJsUrl(String paramString, String[] paramArrayOfString)
  {
    StringBuilder localStringBuilder = new StringBuilder();
    localStringBuilder.append("javascript:");
    localStringBuilder.append(paramString);
    localStringBuilder.append("(");
    int i = 0;
    while (true)
    {
      if (i >= paramArrayOfString.length)
      {
        localStringBuilder.append(")");
        Log.i(TAG, "loadUrl: " + localStringBuilder.toString());
        return localStringBuilder.toString();
      }
      localStringBuilder.append(paramArrayOfString[i]);
      if (i != paramArrayOfString.length - 1)
        localStringBuilder.append(",");
      ++i;
    }
  }

  private LeagueManager getLeagueManager()
  {
    return getRepositoryService().getLeagueManager();
  }

  private RepositoryManager getRepositoryManager()
  {
    return getRepositoryService().getRepositoryManager();
  }

  private RepositoryService getRepositoryService()
  {
    return ((ScoreApplication)getApplication()).getRepositoryService();
  }

  private boolean hasNextRoundData()
  {
    int i;
    if (this.currentRound == this.totalRound)
    {
      Toast.makeText(this, "往下没有数据了", 0).show();
      i = 0;
    }
    while (true)
    {
      return i;
      i = 1;
    }
  }

  private boolean hasPerviousRoundData()
  {
    int i;
    if (this.currentRound == 1)
    {
      Toast.makeText(this, "往上没有数据了", 0).show();
      i = 0;
    }
    while (true)
    {
      return i;
      i = 1;
    }
  }

  private void resetLeagueButtons()
  {
    this.btn_league_daxiao.setSelected(false);
    this.btn_league_points.setSelected(false);
    this.btn_league_rangqiu.setSelected(false);
    this.btn_league_schedule.setSelected(false);
    this.btn_league_shooter.setSelected(false);
  }

  private void resetSelection()
  {
    resetLeagueButtons();
    this.btn_league_points.setSelected(true);
    this.currentSelection = 0;
    String[] arrayOfString = new String[4];
    arrayOfString[0] = "true";
    arrayOfString[1] = "'" + this.league.getLeagueId() + "'";
    arrayOfString[2] = "'" + this.currentSeason + "'";
    arrayOfString[3] = "0";
    this.jsUrl = getJsUrl("displayJifen", arrayOfString);
    showProgressDialog();
    this.webView.loadUrl(this.jsUrl);
  }

  private void setCurrentRoundButtonOnClickListener()
  {
    this.btn_schedule_current_round.setOnClickListener(new View.OnClickListener(this)
    {
      public void onClick()
      {
        new AlertDialog.Builder(this.this$0).setTitle(2131361824).setSingleChoiceItems(this.this$0.rounds, this.this$0.lastCheckedRound, new DialogInterface.OnClickListener(this)
        {
          public void onClick(, int paramInt)
          {
            Log.d(LeagueScheduleActivity.access$1(), "click " + paramInt);
            paramDialogInterface.dismiss();
            LeagueScheduleActivity.9.access$0(this.this$1).lastCheckedRound = paramInt;
            String str = (String)LeagueScheduleActivity.9.access$0(this.this$1).rounds[paramInt];
            Log.d(LeagueScheduleActivity.access$1(), "click " + str);
            LeagueScheduleActivity.9.access$0(this.this$1).btn_schedule_current_round.setText(str);
            LeagueScheduleActivity.9.access$0(this.this$1).currentRound = (paramInt + 1);
            LeagueScheduleActivity.9.access$0(this.this$1).loadingJs = true;
            LeagueScheduleActivity.access$11(LeagueScheduleActivity.9.access$0(this.this$1));
          }
        }).setNegativeButton(2131361823, new DialogInterface.OnClickListener(this)
        {
          public void onClick(, int paramInt)
          {
            Log.d(LeagueScheduleActivity.access$1(), "click cancel");
          }
        }).create().show();
      }
    });
  }

  private void setDaxiaoButtonOnClickListener()
  {
    this.btn_league_daxiao.setOnClickListener(new View.OnClickListener(this)
    {
      public void onClick()
      {
        if ((LeagueScheduleActivity.access$5(this.this$0) == 3) && (!(this.this$0.refreshFlag)));
        while (true)
        {
          return;
          this.this$0.refreshFlag = false;
          this.this$0.loadingJs = true;
          this.this$0.layout_round.setVisibility(8);
          LeagueScheduleActivity.access$6(this.this$0);
          this.this$0.btn_league_daxiao.setSelected(true);
          LeagueScheduleActivity.access$7(this.this$0, 3);
          LeagueScheduleActivity localLeagueScheduleActivity1 = this.this$0;
          LeagueScheduleActivity localLeagueScheduleActivity2 = this.this$0;
          String[] arrayOfString = new String[4];
          arrayOfString[0] = "true";
          arrayOfString[1] = "'" + this.this$0.league.getLeagueId() + "'";
          arrayOfString[2] = "'" + this.this$0.currentSeason + "'";
          arrayOfString[3] = "0";
          localLeagueScheduleActivity1.jsUrl = LeagueScheduleActivity.access$8(localLeagueScheduleActivity2, "displayDaxiao", arrayOfString);
          LeagueScheduleActivity.access$9(this.this$0);
          this.this$0.webView.loadUrl(this.this$0.jsUrl);
        }
      }
    });
  }

  private void setLeftFlingGuestureAction()
  {
    switch (this.currentSelection)
    {
    default:
    case 4:
    case 3:
    case 2:
    case 1:
    }
    while (true)
    {
      while (true)
      {
        while (true)
        {
          while (true)
          {
            return;
            this.btn_league_daxiao.performClick();
          }
          this.btn_league_rangqiu.performClick();
        }
        this.btn_league_schedule.performClick();
      }
      this.btn_league_points.performClick();
    }
  }

  private void setNextRoundButtonOnClickListener()
  {
    this.btn_schedule_next_round.setOnClickListener(new View.OnClickListener(this)
    {
      public void onClick()
      {
        if (!(LeagueScheduleActivity.access$12(this.this$0)));
        while (true)
        {
          return;
          this.this$0.loadingJs = true;
          LeagueScheduleActivity localLeagueScheduleActivity = this.this$0;
          localLeagueScheduleActivity.currentRound = (1 + localLeagueScheduleActivity.currentRound);
          this.this$0.lastCheckedRound = this.this$0.currentRound;
          this.this$0.btn_schedule_current_round.setText("第" + this.this$0.currentRound + "轮");
          LeagueScheduleActivity.access$11(this.this$0);
        }
      }
    });
  }

  private void setPointsButtonOnClickListener()
  {
    this.btn_league_points.setOnClickListener(new View.OnClickListener(this)
    {
      public void onClick()
      {
        if ((LeagueScheduleActivity.access$5(this.this$0) == 0) && (!(this.this$0.refreshFlag)));
        while (true)
        {
          return;
          this.this$0.refreshFlag = false;
          this.this$0.loadingJs = true;
          this.this$0.layout_round.setVisibility(8);
          LeagueScheduleActivity.access$6(this.this$0);
          this.this$0.btn_league_points.setSelected(true);
          LeagueScheduleActivity.access$7(this.this$0, 0);
          LeagueScheduleActivity localLeagueScheduleActivity1 = this.this$0;
          LeagueScheduleActivity localLeagueScheduleActivity2 = this.this$0;
          String[] arrayOfString = new String[4];
          arrayOfString[0] = "true";
          arrayOfString[1] = "'" + this.this$0.league.getLeagueId() + "'";
          arrayOfString[2] = "'" + this.this$0.currentSeason + "'";
          arrayOfString[3] = "0";
          localLeagueScheduleActivity1.jsUrl = LeagueScheduleActivity.access$8(localLeagueScheduleActivity2, "displayJifen", arrayOfString);
          LeagueScheduleActivity.access$9(this.this$0);
          this.this$0.webView.loadUrl(this.this$0.jsUrl);
        }
      }
    });
  }

  private void setPreviousRoundButtonOnClickListener()
  {
    this.btn_schedule_previous_round.setOnClickListener(new View.OnClickListener(this)
    {
      public void onClick()
      {
        if (!(LeagueScheduleActivity.access$10(this.this$0)));
        while (true)
        {
          return;
          this.this$0.loadingJs = true;
          LeagueScheduleActivity localLeagueScheduleActivity = this.this$0;
          localLeagueScheduleActivity.currentRound -= 1;
          this.this$0.lastCheckedRound = this.this$0.currentRound;
          this.this$0.btn_schedule_current_round.setText("第" + this.this$0.currentRound + "轮");
          LeagueScheduleActivity.access$11(this.this$0);
        }
      }
    });
  }

  private void setRangqiuButtonOnClickListener()
  {
    this.btn_league_rangqiu.setOnClickListener(new View.OnClickListener(this)
    {
      public void onClick()
      {
        if ((LeagueScheduleActivity.access$5(this.this$0) == 2) && (!(this.this$0.refreshFlag)));
        while (true)
        {
          return;
          this.this$0.refreshFlag = false;
          this.this$0.loadingJs = true;
          this.this$0.layout_round.setVisibility(8);
          LeagueScheduleActivity.access$6(this.this$0);
          this.this$0.btn_league_rangqiu.setSelected(true);
          LeagueScheduleActivity.access$7(this.this$0, 2);
          LeagueScheduleActivity localLeagueScheduleActivity1 = this.this$0;
          LeagueScheduleActivity localLeagueScheduleActivity2 = this.this$0;
          String[] arrayOfString = new String[4];
          arrayOfString[0] = "true";
          arrayOfString[1] = "'" + this.this$0.league.getLeagueId() + "'";
          arrayOfString[2] = "'" + this.this$0.currentSeason + "'";
          arrayOfString[3] = "0";
          localLeagueScheduleActivity1.jsUrl = LeagueScheduleActivity.access$8(localLeagueScheduleActivity2, "displayRangqiu", arrayOfString);
          LeagueScheduleActivity.access$9(this.this$0);
          this.this$0.webView.loadUrl(this.this$0.jsUrl);
        }
      }
    });
  }

  private void setRightFlingGuestureAction()
  {
    switch (this.currentSelection)
    {
    default:
    case 0:
    case 1:
    case 2:
    case 3:
    }
    while (true)
    {
      while (true)
      {
        while (true)
        {
          while (true)
          {
            return;
            this.btn_league_schedule.performClick();
          }
          this.btn_league_rangqiu.performClick();
        }
        this.btn_league_daxiao.performClick();
      }
      this.btn_league_shooter.performClick();
    }
  }

  private void setScheduleButtonOnClickListener()
  {
    this.btn_league_schedule.setOnClickListener(new View.OnClickListener(this)
    {
      public void onClick()
      {
        if ((LeagueScheduleActivity.access$5(this.this$0) == 1) && (!(this.this$0.refreshFlag)));
        while (true)
        {
          return;
          this.this$0.refreshFlag = false;
          this.this$0.loadingJs = true;
          this.this$0.layout_round.setVisibility(0);
          LeagueScheduleActivity.access$6(this.this$0);
          this.this$0.btn_league_schedule.setSelected(true);
          LeagueScheduleActivity.access$7(this.this$0, 1);
          LeagueScheduleActivity localLeagueScheduleActivity1 = this.this$0;
          LeagueScheduleActivity localLeagueScheduleActivity2 = this.this$0;
          String[] arrayOfString = new String[5];
          arrayOfString[0] = "true";
          arrayOfString[1] = "'" + this.this$0.league.getLeagueId() + "'";
          arrayOfString[2] = "'" + this.this$0.currentSeason + "'";
          arrayOfString[3] = "'" + this.this$0.currentRound + "'";
          arrayOfString[4] = "0";
          localLeagueScheduleActivity1.jsUrl = LeagueScheduleActivity.access$8(localLeagueScheduleActivity2, "displaySchedule", arrayOfString);
          Log.d(LeagueScheduleActivity.access$1(), "show dialog");
          LeagueScheduleActivity.access$9(this.this$0);
          this.this$0.webView.loadUrl(this.this$0.jsUrl);
        }
      }
    });
  }

  private void setSeasonButtonOnClickListener()
  {
    this.btn_league_season.setOnClickListener(new View.OnClickListener(this)
    {
      public void onClick()
      {
        new AlertDialog.Builder(this.this$0).setTitle(2131361825).setSingleChoiceItems(this.this$0.seasons, this.this$0.lastCheckedSeason, new DialogInterface.OnClickListener(this)
        {
          public void onClick(, int paramInt)
          {
            Log.d(LeagueScheduleActivity.access$1(), "click " + paramInt);
            paramDialogInterface.dismiss();
            LeagueScheduleActivity.1.access$0(this.this$1).lastCheckedSeason = paramInt;
            LeagueScheduleActivity.1.access$0(this.this$1).currentSeason = ((String)LeagueScheduleActivity.1.access$0(this.this$1).seasons[paramInt]);
            LeagueScheduleActivity.1.access$0(this.this$1).loadingJs = true;
            LeagueScheduleActivity.access$2(LeagueScheduleActivity.1.access$0(this.this$1)).loadRoundInfo(LeagueScheduleActivity.1.access$0(this.this$1), LeagueScheduleActivity.1.access$0(this.this$1), LeagueScheduleActivity.1.access$0(this.this$1).leagueId, LeagueScheduleActivity.1.access$0(this.this$1).currentSeason);
            LeagueScheduleActivity.1.access$0(this.this$1).layout_round.setVisibility(8);
            LeagueScheduleActivity.access$3(LeagueScheduleActivity.1.access$0(this.this$1));
            LeagueScheduleActivity.access$4(LeagueScheduleActivity.1.access$0(this.this$1));
          }
        }).setNegativeButton(2131361823, new DialogInterface.OnClickListener(this)
        {
          public void onClick(, int paramInt)
          {
            Log.d(LeagueScheduleActivity.access$1(), "click cancel");
          }
        }).create().show();
      }
    });
  }

  private void setShooterButtonOnClickListener()
  {
    this.btn_league_shooter.setOnClickListener(new View.OnClickListener(this)
    {
      public void onClick()
      {
        if ((LeagueScheduleActivity.access$5(this.this$0) == 4) && (!(this.this$0.refreshFlag)));
        while (true)
        {
          return;
          this.this$0.refreshFlag = false;
          this.this$0.loadingJs = true;
          this.this$0.layout_round.setVisibility(8);
          LeagueScheduleActivity.access$6(this.this$0);
          this.this$0.btn_league_shooter.setSelected(true);
          LeagueScheduleActivity.access$7(this.this$0, 4);
          LeagueScheduleActivity localLeagueScheduleActivity1 = this.this$0;
          LeagueScheduleActivity localLeagueScheduleActivity2 = this.this$0;
          String[] arrayOfString = new String[4];
          arrayOfString[0] = "true";
          arrayOfString[1] = "'" + this.this$0.league.getLeagueId() + "'";
          arrayOfString[2] = "'" + this.this$0.currentSeason + "'";
          arrayOfString[3] = "0";
          localLeagueScheduleActivity1.jsUrl = LeagueScheduleActivity.access$8(localLeagueScheduleActivity2, "displayScorer", arrayOfString);
          LeagueScheduleActivity.access$9(this.this$0);
          this.this$0.webView.loadUrl(this.this$0.jsUrl);
        }
      }
    });
  }

  private void showDefaultWebview()
  {
    this.webView.addJavascriptInterface(new Object(this)
    {
      public void showWebview()
      {
        this.this$0.handler.post(new Runnable(this)
        {
          public void run()
          {
            LeagueScheduleActivity.10.access$0(this.this$1).btn_league_points.setSelected(true);
            LeagueScheduleActivity localLeagueScheduleActivity1 = LeagueScheduleActivity.10.access$0(this.this$1);
            LeagueScheduleActivity localLeagueScheduleActivity2 = LeagueScheduleActivity.10.access$0(this.this$1);
            String[] arrayOfString = new String[4];
            arrayOfString[0] = "true";
            arrayOfString[1] = "'" + LeagueScheduleActivity.10.access$0(this.this$1).league.getLeagueId() + "'";
            arrayOfString[2] = "'" + LeagueScheduleActivity.10.access$0(this.this$1).currentSeason + "'";
            arrayOfString[3] = "0";
            localLeagueScheduleActivity1.jsUrl = LeagueScheduleActivity.access$8(localLeagueScheduleActivity2, "displayJifen", arrayOfString);
            LeagueScheduleActivity.10.access$0(this.this$1).webView.loadUrl(LeagueScheduleActivity.10.access$0(this.this$1).jsUrl);
            LeagueScheduleActivity.10.access$0(this.this$1).loadingJs = true;
          }
        });
      }
    }
    , "repository");
  }

  private void showProgressDialog()
  {
    this.startLoadingTime = System.currentTimeMillis();
    showProgressDialog("", "加载数据中...");
    startHideDialogTimer();
    this.hasProgress = true;
  }

  private void startHideDialogTimer()
  {
    this.hideDialogTimer = new Timer();
    this.hideDialogTimer.schedule(new HideProgressTask(this, null), 1000L, 1000L);
  }

  private void stopHideDialogTimer()
  {
    if (this.hideDialogTimer != null)
    {
      this.hideDialogTimer.cancel();
      this.hideDialogTimer = null;
    }
  }

  private void updateCurrentRoundButton()
  {
    int i;
    String[] arrayOfString = getLeagueManager().getLeagueRound();
    this.totalRound = Integer.parseInt(arrayOfString[0]);
    if (this.currentSeason.equals(this.seasons[0]))
    {
      this.currentRound = Integer.parseInt(arrayOfString[1]);
      this.lastCheckedRound = (this.currentRound - 1);
      this.btn_schedule_current_round.setText("第" + this.currentRound + "轮");
      this.rounds = new CharSequence[this.totalRound];
      i = 1;
    }
    while (true)
    {
      while (i > this.totalRound)
      {
        return;
        this.currentRound = 1;
      }
      this.rounds[(i - 1)] = "第" + i + "轮";
      ++i;
    }
  }

  private void updateSchedule()
  {
    String[] arrayOfString = new String[5];
    arrayOfString[0] = "true";
    arrayOfString[1] = "'" + this.league.getLeagueId() + "'";
    arrayOfString[2] = "'" + this.currentSeason + "'";
    arrayOfString[3] = "'" + this.currentRound + "'";
    arrayOfString[4] = "0";
    this.jsUrl = getJsUrl("displaySchedule", arrayOfString);
    showProgressDialog();
    this.webView.loadUrl(this.jsUrl);
  }

  private void updateTitle()
  {
    this.txt_league_season.setText(this.league.getShortName() + "  " + this.currentSeason + "赛季");
  }

  public void loadAllRepositoryFinish(ResultCodeType paramResultCodeType)
  {
  }

  public void loadGroupInfoFinish(ResultCodeType paramResultCodeType)
  {
  }

  public void loadRoundInfoFinish(ResultCodeType paramResultCodeType)
  {
    updateCurrentRoundButton();
  }

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    requestWindowFeature(1);
    setContentView(2130903096);
    this.bundle = getIntent().getExtras();
    this.leagueId = this.bundle.getString("leagueId");
    this.repositoryManager = getRepositoryManager();
    this.leagueManager = getLeagueManager();
    this.txt_league_season = ((TextView)findViewById(2131558627));
    this.btn_league_season = ((Button)findViewById(2131558628));
    this.btn_league_points = ((Button)findViewById(2131558630));
    this.btn_league_schedule = ((Button)findViewById(2131558631));
    this.btn_league_rangqiu = ((Button)findViewById(2131558632));
    this.btn_league_daxiao = ((Button)findViewById(2131558633));
    this.btn_league_shooter = ((Button)findViewById(2131558634));
    this.layout_round = ((RelativeLayout)findViewById(2131558635));
    this.layout_round.setVisibility(8);
    this.btn_schedule_previous_round = ((Button)findViewById(2131558636));
    this.btn_schedule_current_round = ((Button)findViewById(2131558637));
    this.btn_schedule_next_round = ((Button)findViewById(2131558638));
    this.hideDialogTimer = new Timer();
    this.webView = ((WebView)findViewById(2131558639));
    this.webView.getSettings().setJavaScriptEnabled(true);
    this.webView.getSettings().setBuiltInZoomControls(true);
    this.webView.setVerticalScrollBarEnabled(true);
    this.webView.setVerticalScrollbarOverlay(true);
    this.webView.getSettings().setAppCacheEnabled(true);
    this.webView.getSettings().setCacheMode(-1);
    showDefaultWebview();
    this.league = this.leagueManager.findLeagueById(this.leagueId);
    List localList = this.league.getSeasonList();
    this.seasons = new CharSequence[localList.size()];
    int i = 0;
    while (true)
    {
      if (i >= localList.size())
      {
        this.currentSeason = ((String)this.seasons[0]);
        updateTitle();
        getRepositoryService().loadRoundInfo(this, this, this.leagueId, this.currentSeason);
        setSeasonButtonOnClickListener();
        setPointsButtonOnClickListener();
        setScheduleButtonOnClickListener();
        setRangqiuButtonOnClickListener();
        setDaxiaoButtonOnClickListener();
        setShooterButtonOnClickListener();
        setPreviousRoundButtonOnClickListener();
        setCurrentRoundButtonOnClickListener();
        setNextRoundButtonOnClickListener();
        return;
      }
      this.seasons[i] = ((CharSequence)localList.get(i));
      ++i;
    }
  }

  public boolean onDown(MotionEvent paramMotionEvent)
  {
    return false;
  }

  public boolean onFling(MotionEvent paramMotionEvent1, MotionEvent paramMotionEvent2, float paramFloat1, float paramFloat2)
  {
    if ((paramMotionEvent1.getX() - paramMotionEvent2.getX() > 60.0F) && (Math.abs(paramFloat1) > 0F))
    {
      Log.d(TAG, "向左手势");
      setLeftFlingGuestureAction();
    }
    while (true)
    {
      do
        return false;
      while ((paramMotionEvent2.getX() - paramMotionEvent1.getX() <= 60.0F) || (Math.abs(paramFloat1) <= 0F));
      Log.d(TAG, "向右手势");
      setRightFlingGuestureAction();
    }
  }

  public void onLongPress(MotionEvent paramMotionEvent)
  {
  }

  protected void onPause()
  {
    super.onPause();
    hideDialog();
    this.hasProgress = false;
    this.loadingJs = false;
    resetLeagueButtons();
    this.currentSelection = 0;
    stopHideDialogTimer();
  }

  public void onRefresh()
  {
    this.refreshFlag = true;
    switch (this.currentSelection)
    {
    default:
    case 4:
    case 3:
    case 2:
    case 1:
    case 0:
    }
    while (true)
    {
      while (true)
      {
        while (true)
        {
          while (true)
          {
            while (true)
            {
              return;
              this.btn_league_shooter.performClick();
            }
            this.btn_league_daxiao.performClick();
          }
          this.btn_league_rangqiu.performClick();
        }
        this.btn_league_schedule.performClick();
      }
      this.btn_league_points.performClick();
    }
  }

  protected void onResume()
  {
    showProgressDialog();
    this.webView.loadUrl(LEAGUE_REPOSITORY_HTML);
    super.onResume();
  }

  public boolean onScroll(MotionEvent paramMotionEvent1, MotionEvent paramMotionEvent2, float paramFloat1, float paramFloat2)
  {
    return false;
  }

  public void onShowPress(MotionEvent paramMotionEvent)
  {
  }

  public boolean onSingleTapUp(MotionEvent paramMotionEvent)
  {
    return false;
  }

  public boolean onTouch(View paramView, MotionEvent paramMotionEvent)
  {
    Log.d(TAG, "touch");
    return this.gestureDetector.onTouchEvent(paramMotionEvent);
  }

  private class HideProgressTask extends TimerTask
  {
    public void run()
    {
      if ((this.this$0.webView.getProgress() == 100) && (this.this$0.hasProgress) && (this.this$0.loadingJs))
      {
        this.this$0.hideDialog();
        LeagueScheduleActivity.access$0(this.this$0);
        this.this$0.hasProgress = false;
        this.this$0.loadingJs = false;
      }
      while (true)
      {
        do
          return;
        while (System.currentTimeMillis() - this.this$0.startLoadingTime <= 8000L);
        this.this$0.hideDialog();
        LeagueScheduleActivity.access$0(this.this$0);
        this.this$0.webView.stopLoading();
        this.this$0.hasProgress = false;
        this.this$0.loadingJs = false;
        Log.w(LeagueScheduleActivity.access$1(), "network speed too slow!");
        this.this$0.errorHandler.post(new Runnable(this)
        {
          public void run()
          {
            Toast.makeText(LeagueScheduleActivity.HideProgressTask.access$1(this.this$1), "你的网速太慢啦，加载失败，请刷新重新加载！", 0).show();
          }
        });
      }
    }
  }
}